<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <% String title = "全安药业信息综合系统后台登陆"; %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
	//点击登录
	function login() {
		var params = $("#login").serialize();
		sendRequest(pageContextPath + "/user/toLogin.do", params,
			function(responseJson) {
				if (responseJson.data.message != null) {
					$("#haha").html("");
					var html = '<p>'+responseJson.data.message+'</p>';
					$("#haha").html(html);
					$( "#haha" ).dialog( "open" );
				} else {
					//登陆成功则，加载用户权限跳转到首页。
					window.location.href = "index.jsp";
				}
		});
	}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<!-- jquery-ui插件的样式 -->
<link href="jquery-ui-1.12.1/jquery-ui.css" rel="stylesheet">	
</head>
<body>
	<div id="haha" title="Dialog Title" >
		<p>点击Open Dialog，显示的内容</p>
	</div>
	
	<form id="login">
		
		<div class="">
			
			<div class="">
				<div class="">
					<input type="text" class="" placeholder="请输入用户名" name="username">
				</div>
			</div>
			<div class="">
				<div class="">
					<input type="password" class="" placeholder="请输入用户密码" name="password">
				</div>
			</div>
			<div class="">
				<a href="#" class="social-link"  onclick="login()"> <i class="icon-skype"></i>
					<span>登 录</span>
				</a>
			</div>
			
		</div>
	</form>
	
	<script src="js/jquery-1.8.3.min.js"></script>
	<script src="javascript/httpService.js"></script>
	
	<!-- jQuery-UI插件相关js的引入 -->
	<script src="jquery-ui-1.12.1/external/jquery/jquery.js"></script>
	<script src="jquery-ui-1.12.1/jquery-ui.js"></script>

	<script>	
		//点击打开对话框 后的相关操作
		$("#haha").dialog({
			autoOpen: false,
			width: 400,
			title:'<%=title%>',
			buttons: [
				{
					text: "知道了",
					click: function() {
						$( this ).dialog( "close" );
					}
				}
			]
		});
	</script>		
</body>
</html>